"""Added cash payment

Revision ID: 4ea3e1ee37ba
Revises: b6833b0ba9eb
Create Date: 2024-01-20 13:03:48.104371

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "4ea3e1ee37ba"
down_revision = "b6833b0ba9eb"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("ALTER TYPE currency ADD VALUE 'cash';")
    op.alter_column(
        "promocode",
        "status",
        existing_type=postgresql.ENUM("active", "archive", name="promocodestatus"),
        nullable=False,
        existing_server_default=sa.text("'active'::promocodestatus"),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("ALTER TYPE currency DROP VALUE 'cash';")
    op.alter_column(
        "promocode",
        "status",
        existing_type=postgresql.ENUM("active", "archive", name="promocodestatus"),
        nullable=True,
        existing_server_default=sa.text("'active'::promocodestatus"),
    )
    # ### end Alembic commands ###
